<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>{{title}}</title>
    {{> 'public\loadCss'}}
    <style>
        .row {
            background-color: #e6e6e6;
        }

        .center {
            background-color: #fff;
            padding: 30px;
            border-radius: 10px;
            margin-top: 15%;
            margin-bottom: 10%;
        }
    </style>
</head>
<body>
<div class="container clearfix">
    <div class="row">
        <div class="col-md-5 col-md-offset-3 center">
            <form class="form-horizontal" action="/user/login" onsubmit="return false">
                <fieldset>
                    <legend>
                        {{title}}
                    </legend>
                    <div class="form-group has-feedback">
                        <label for="Username" class="col-sm-2 control-label">用户名</label>

                        <div class="col-sm-10">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                <!--data-resettable 需要绑定重置事件-->
                                <input type="text" class="form-control" name="username" id="Username" data-resettable data-type="{{type}}" aria-describedby="UsernameStatus"
                                       placeholder="Username">
                            </div>
                            <span class="glyphicon  fa-spin form-control-feedback" aria-hidden="true"></span>
                            <!--<i class="fa fa-spin glyphicon-refresh fa-spinner fa-lg form-control-feedback" aria-hidden="true"></i>-->
                            <span id="UsernameStatus" class="sr-only">(success)</span>
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group has-feedback">
                        <label for="Password" class="col-sm-2 control-label">密&nbsp;&nbsp;&nbsp;&nbsp;码</label>

                        <div class="col-sm-10">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-key"></i></span>
                                <input type="password" class="form-control" name="password" data-resettable data-type="{{type}}" id="Password" aria-describedby="PasswordStatus"
                                       placeholder="Password">
                            </div>
                            <span class="glyphicon  form-control-feedback" aria-hidden="true"></span>
                            <span id="PasswordStatus" class="sr-only">(success)</span>
                            <span class="help-block"></span>
                        </div>
                    </div>
                    {{#equals type 'register'}}
                        <div class="form-group has-feedback">
                            <label for="Password" class="col-sm-2 control-label">邀请码</label>

                            <div class="col-sm-10">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-send"></i></span>
                                    <input type="text" class="form-control" name="text" data-resettable data-type="{{type}}" id="reqCode" aria-describedby="reqCodeStatus"
                                           placeholder="邀请码">
                                </div>
                                <span class="glyphicon  form-control-feedback" aria-hidden="true"></span>
                                <span id="reqCodeStatus" class="sr-only">(success)</span>
                                <span class="help-block"></span>
                            </div>
                        </div>
                    {{/equals}}
                    <!-- <div class="form-group">
                         <div class="col-sm-offset-2 col-sm-10">
                             <div class="checkbox">
                                 <label>
                                     <input type="checkbox"> Remember me
                                 </label>
                             </div>
                         </div>
                     </div>-->

                    <div class="form-group">
                        <div class="col-md-offset-4 col-md-5">
                            {{#equals type 'login'}}
                                <button type="button" class="btn btn-default" data-loading-text="登录中..." autocomplete="off" onclick="$.User.login('#Username','#Password')">登录</button>
                            {{/equals}}
                            {{#equals type 'register'}}
                                <button type="button" class="btn btn-default" data-loading-text="注册中..." autocomplete="off" onclick="$.User.register('#Username','#Password', '#reqCode')">注册</button>
                            {{/equals}}

                            <a href="{{config.siteUrl}}" class="btn btn-default">返回</a>
                        </div>
                    </div>

                </fieldset>
            </form>
        </div>
    </div>
    {{> 'public\loadJs'}}
</div>
</body>
</html>